package com.yj.testbook_yj.utils;

import com.fasterxml.uuid.EthernetAddress;
import com.fasterxml.uuid.Generators;
import com.fasterxml.uuid.impl.TimeBasedGenerator;

import java.util.UUID;

public class UUIDUtil {
    private UUIDUtil(){

    }

    public static String getUuid(){
        // 传入网卡信息，基于时间制作出生成器
        TimeBasedGenerator generator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
        UUID uuid = generator.generate();
        return uuid.toString().replaceAll("-", "");
    }
}
